package com.function.controller;

import com.function.domin.pojo.Result;
import com.function.service.WenXinService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@Slf4j
@RestController
@Api(tags = "文心一言接口")
public class WenXinController {

    @Autowired
    private WenXinService wenXinService;

    /**
     * 调用文心一言
     * @return
     */
    @ApiOperation("调用文心一言")
    @GetMapping("/wenxin")
    public Result wenXin(String content) throws Exception {
        String answer = wenXinService.getAnswer(content);
        return Result.success(answer);
    }

}
